{extend name="layout:main" /}

{block name="main"}
<div class="layui-tab" lay-filter="test-hash">
    <ul class="layui-tab-title">
        <li class="layui-this" lay-id="11">框架表</li>
        <li lay-id="22">应用表</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            {foreach $tables as $table}
            <h2>{$table.TABLE_NAME}</h2>
            <table class="layui-table">
                <thead>
                <tr>
                    <th>字段</th>
                    <th>备注</th>
                    <th>类型</th>
                    <th>长度</th>
                    <th>默认值</th>
                    <th>主键</th>
                    <th>自增</th>
                    <th>可为空</th>
                </tr>
                </thead>
                <tbody>
                {foreach $table.columns as $column}
                <tr>
                    <td>{$column.field}</td>
                    <td>{$column.comment}</td>
                    <td>{$column.type}</td>
                    <td>{$column.length}</td>
                    <td>{$column.default}</td>
                    <td>{$column.primary_key}</td>
                    <td>{$column.auto_increment}</td>
                    <td>{$column.nullable}</td>
                </tr>
                {/foreach}
                </tbody>
            </table>
            {/foreach}
        </div>
        <div class="layui-tab-item">
            {foreach $app_tables as $table}
            <h2>{$table.TABLE_NAME}</h2>
            <table class="layui-table">
                <thead>
                <tr>
                    <th>字段</th>
                    <th>备注</th>
                    <th>类型</th>
                    <th>长度</th>
                    <th>默认值</th>
                    <th>主键</th>
                    <th>自增</th>
                    <th>可为空</th>
                </tr>
                </thead>
                <tbody>
                {foreach $table.columns as $column}
                <tr>
                    <td>{$column.field}</td>
                    <td>{$column.comment}</td>
                    <td>{$column.type}</td>
                    <td>{$column.length}</td>
                    <td>{$column.default}</td>
                    <td>{$column.primary_key}</td>
                    <td>{$column.auto_increment}</td>
                    <td>{$column.nullable}</td>
                </tr>
                {/foreach}
                </tbody>
            </table>
            {/foreach}
        </div>
    </div>
</div>

<script>
    layui.use(function(){
        var element = layui.element;
        var util = layui.util;
        // 自定义固定条
        util.fixbar({});
    });
</script>
{/block}